package com.ruoyi.web.controller.accommon;

import com.ruoyi.web.mapper.ProcessListMapper;
import com.ruoyi.web.domain.ProcessList;
import com.ruoyi.web.util.AjaxResponse;
import com.ruoyi.web.util.GlobalConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author wfl
 * @date 2021年04月07日 10:20
 */
@RestController
@RequestMapping("processList")
public class ProcessListController {

    @Autowired
    private ProcessListMapper processListMapper;
    
    @RequestMapping("getAll")
    public AjaxResponse getAll(){
        try {
            List<ProcessList> all = processListMapper.getAll();
            return AjaxResponse.AjaxData(GlobalConfig.ResponseCode.SUCCESS.getCode(),
                    GlobalConfig.ResponseCode.SUCCESS.getDesc(), all);
        } catch (Exception e) {
            return AjaxResponse.AjaxData(GlobalConfig.ResponseCode.ERROR.getCode(),
                    "获取历史任务失败", e.toString());
        }
    }
}
